<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$content_info.title} - {$channel_info.name} - {$config.site_name}</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="templates/{$config.site_template}/style.css" />
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/jquery.editor.js"></script>
<script type="text/javascript" src="scripts/jquery.editor.ubb.js"></script>
<script type="text/javascript">
{literal}
var e;
$(function(){
	e=$('#content_text').xheditor(true,{tools:'simple',
			shortcuts:{
				'ctrl+enter':function(){
					$('#content_info').submit();
				}
			}
	});
});
function editor_insert(html){
	e.pasteHTML(html);
}
var attachmentnum=1;
function addattachment(obj){
  if(attachmentnum>=10)return;
document.getElementById('content_attachment').innerHTML+="<div style=\"padding:2px 0\"'><input type=\"file\" name=\"content_attachment[]\" size=\"30\"  class=\"input\"/>&nbsp;<a href=\"javascript:;\" onclick=\"removeattachment(this)\">[-]</a></div>";
  attachmentnum++;
}
function removeattachment(obj){
var parent=obj.parentNode;
	parent.innerHTML='';
	parent.parentNode.removeChild(parent);
  attachmentnum--;
}
{/literal} 
</script>
</head>
<body>
{include file="header.html"}
<div id="middle">
		<div class="box">
		<form action="content.php?action={$mode}" method="post" enctype="multipart/form-data" name="content_info">
			<table width="100%">
		{if $category_list!=''}
			<tr>
				<td width="60" height="30">{$language.content_category}</td>
				<td>
					<select name="category_id">{$category_list}</select>
		</td>
				</tr>
		{/if}
				<tr>
				<td width="60" height="30">{$language.content_title}</td>
				<td><input type="text" name="content_title" style="width:892px;"  value="{$content.title|escape:html}" class="input"/></td>
				</tr>

				<tr>
				<td valign="top">{$language.content_text}</td>
				<td><textarea name="content_text" id="content_text" style="width:900px;height:300px">{$content.text|escape:html}</textarea></td>
				</tr>

				<tr>
				<td height="30">{$language.content_thumb}</td>
				<td><input type="file" name="content_thumb" size="30"  class="input"/>
				{if $content.thumb}
				<a href="uploads/{$content.thumb}" target="_blank"><img src="uploads/{$content.thumb}" alt="" align="absmiddle" style="width:20px;height:20px;border:1px solid #ccc;padding:1px"/></a>
				<label><input type="checkbox" name="content_thumb_delete" value="{$content.thumb}" /> {$language.delete}</label>
				<input type="hidden" name="content_thumb_old" value="{$content.thumb}"/>
				{/if}
				</td>
				</tr>

				<tr>
				<td height="30" valign="top">{$language.content_attachment}</td>
				<td>
						{foreach from=$content.attachment item=attachment}
					<div style="padding:4px 0"><input type="checkbox" name="content_attachment_delete[]" value="{$attachment.id}" />&nbsp;<a href="uploads/{$attachment.name}" target="_blank">{$attachment.name}</a>&nbsp<a href="javascript:;" onclick="editor_insert('<a href=uploads\/{$attachment.name}>{$attachment.name}</a>');">[{$language.insert}]</a></div>
					{/foreach}
					<input type="file" name="content_attachment[]" size="30"  class="input"/>&nbsp;<a href="javascript:;" onclick="addattachment(this)">[+]</a>
					<div id="content_attachment"></div>
				</td>
				</tr>
				<tr>
				<td height="30">{$language.content_password}</td>
				<td><input type="text" name="content_password" size="30" value="{$content.password}" class="input"/></td>
				</tr>
		
				<input type="hidden" name="content_id" value="{$content.id}"/>
				<input type="hidden" name="channel_id" value="{$content.channel_id}"/>
				<tr>
				<td height="30">&nbsp;</td>
				<td><input type="submit" value=" {$language.submit} " class="button"/></td>
				</tr>
			</table>
			
		</form>
</div>
{include file="footer.html"}
</body>
</html>
